#pragma once


#include "ParticleEmitter.h"
#include <string>

namespace e3d
{
	class ParticleEmitterPoint : public ParticleEmitter			// abgeleitet von ParticleEmitter
	{
	public:
		ParticleEmitterPoint(	ID3D10Device* device, ID3D10EffectTechnique* tech, unsigned int numParticles, 
								D3DXVECTOR3 position, D3DXVECTOR3 preferredDirection, float angle, float impulse, std::wstring texture );
		~ParticleEmitterPoint(void);

		// Getter
		D3DXVECTOR3 getPosition() {				return m_position; };
		D3DXVECTOR3 getPreferredDirection() {	return m_preferredDirection; };
		float getAngle() {						return m_angle; };
		unsigned int getNumParticles() {		return m_numParticles; };

		// Setter
		void setPosition(D3DXVECTOR3 newPos) { m_position = newPos; };
		void setNumParticles(unsigned int num) { m_numParticles = num; };

		// Diesen Emitter rendern
		void render();

		static void getHandles( ID3D10Effect* effect );


	private:
		
		// Position des Pointemitters ( Quelle, an der die Partikel entstehen... )
		D3DXVECTOR3 m_position;

		// Vozugsrichtung der emittierten Partikel
		D3DXVECTOR3 m_preferredDirection;

		// Winkel bis zu dem die Partikel ausgestreut werden
		float m_angle;

		// Array der derzeitigen Partikel
		Particle* m_particleArray;

		// Anzahl der Partikel ( in diesem Fall: maximale Zahl der Partikel )
		unsigned int m_numParticles;

		static unsigned int s_numEmitters;

		/** Shader variable storing position of point emitter */
		static ID3D10EffectVectorVariable* s_pointPosition;

		/** Shader variable storing index of the emitter being rendered */
		static ID3D10EffectScalarVariable* s_currentEmitter;

		/** Shader variable storing the StartBuffer */
		static ID3D10EffectShaderResourceVariable* s_startBufferHandle;
		
		/** Shader variable storing the Buffer Stride */
		static ID3D10EffectScalarVariable* s_bufferStrideHandle;
	};
}